package com.livepan.server.service;


import com.livepan.server.error.BusinessException;
import com.livepan.server.service.model.ProblemModel;

import javax.validation.constraints.NotNull;
import java.util.List;

public interface ProblemService {
    //通过id得到题目
    ProblemModel getProblemByID(Integer problemId);

    //通过特定的条件查询对应的问题集合 keyword 关键字
    List<ProblemModel> listProblem(String keyword, int offset, int limit, String userId);


    //创建题目
    ProblemModel createProblem(ProblemModel problemModel) throws BusinessException;

    //更新题目
    ProblemModel updateProblem(ProblemModel problemModel) throws BusinessException;


    //查询符合条件的题目的列表的总个数
    Integer queryProblemCount(
            String keyword, Integer contestId
    );


    //题目的提交人数进行加一
    Boolean addSubmitCount(Integer problemId, Integer contestId,@NotNull Integer value);

    //题目的AC人数进行加一
    Boolean addAcceptedCount(Integer problemId, Integer contestId, @NotNull Integer value);
}
